/*Replication file for Aged-Based Messaging Strategies for Communication about COVID-19
Stephen M. Utych
Luke Fowler
Journal of Behavioral Public Administration*/


*Data cleaning and recoding

*Demographics
recode gender (1=0) (2=1) (3=.), gen(female)
recode race (2=1) (1 3 4 5 6 = 0), gen(black)
recode race (3=1) (1 2 4 5 6 = 0), gen(hisp)
recode race (1 4 6 = 1) (2 3 5 = 0), gen(rother)
recode employ (2 3 = 0), gen(ftemp)
recode employ (1 3 = 0) (2=1), gen(ptemp)
recode wah (2=0)

recode children (1/6 = 1), gen(under18)

gen repub=.
replace repub=0 if dem1==1
replace repub=1 if dem1==2
replace repub=2 if ind1==2
replace repub=3 if ind1==3
replace repub=4 if ind1==1
replace repub=5 if rep1==2
replace repub=6 if rep1==1

gen gop = 0 
replace gop = 1 if repub==4|repub==5|repub==6

gen dem = 0
replace dem = 1 if repub==0|repub==1|repub==2

recode ideo (8=.), gen(conserv)

gen histate = 0
replace histate = 1 if state==5|state==10|state==14|state==19|state==23|state==31|state==33|state==49

*Treatments
gen treat=.
replace treat=1 if control!=.
replace treat=2 if others!=.
replace treat=3 if othersex!=.
replace treat=4 if self!=.
replace treat=5 if selfex!=.

label def treat 1 "Control" 2 "Old" 3 "Old Extreme" 4 "Young" 5 "Young Extreme"
label val treat treat 

*Dependent variables

recode coviddv1_1 (8=.)
gen wash1 = 7-coviddv1_1

recode coviddv1_2 (8=.)
gen wash2 = 7-coviddv1_2

recode coviddv1_3 (8=.)
gen cover = 7-coviddv1_3

recode coviddv1_4 (8=.)
gen workh = 7-coviddv1_4

recode coviddv1_5 (8=.)
gen nopay = 7-coviddv1_5

recode coviddv1_6 (8=.)
gen kidhome = 7-coviddv1_6

recode coviddv1_7 (8=.)
gen notleave = 7-coviddv1_7

recode coviddv1_8 (8=.)
gen eatout = 7-coviddv1_8

recode coviddv1_9 (8=.)
gen gym = 7-coviddv1_9

recode coviddv1_10 (8=.)
gen fedreg = 7-coviddv1_10

recode coviddv1_11 (8=.)
gen statereg = 7-coviddv1_11

gen world = 6- coviddv2_1
gen usa = 6-coviddv2_2
gen state2 = 6-coviddv2_3

*Binary DVs for robustness checks

recode wash1 (0/5 = 0) (6=1), gen(w1)
recode wash2 (0/5 = 0) (6=1), gen(w2)
recode cover (0/5 = 0) (6=1), gen(c1)
recode workh (0/5 = 0) (6=1), gen(wh1)
recode fedreg (0/5 = 0) (6=1), gen(f1)
recode statereg (0/5=0) (6=1), gen(sr1)

recode world (0/4 = 0) (5=1), gen(w11)
recode usa (0/4 = 0) (5=1), gen(u1)
recode state2 (0/4 =0) (5=1), gen(ss1)

*Sample descriptives

sum age if treat!=.
sum female if treat!=.
tab repub if treat!=.
tab educ if treat!=.
tab race if treat!=.


*Table 1 - Descriptives of DVs

sum wash1 wash2 cover workh fedreg statereg world usa state2

*Histograms of DVs

hist wash1, xtitle(Wash Hands 1) saving(g1)
hist wash2, xtitle(Wash Hands 2) saving(g2)
hist cover, xtitle(Cover Cough) saving(g3)
hist workh, xtitle(Work Home) saving(g4)
hist fedreg, xtitle(Follow Federal) saving(g5)
hist statereg, xtitle(Follow State) saving(g6)

graph combine g1.gph g2.gph g3.gph g4.gph g5.gph g6.gph


hist world, xtitle(World) saving(g7)
hist usa, xtitle(United States) saving(g8)
hist state2, xtitle(Respondent's State) saving(g9)

graph combine g7.gph g8.gph g9.gph

*Table 2 - Behavioral Intention, Full Sample

reg wash1 i.treat
reg wash2 i.treat
reg cover i.treat
reg workh i.treat
reg fedreg i.treat
reg statereg i.treat

*Table 3 - Behavioral Intention - Millenials and Gen Z

reg wash1 i.treat if age<=40
reg wash2 i.treat if age<=40
reg cover i.treat if age<=40
reg workh i.treat if age<=40
reg fedreg i.treat if age<=40
reg statereg i.treat if age<=40


*Table 4 - Perceptions of seriouness

reg world i.treat 
reg usa i.treat 
reg state2 i.treat 
reg world i.treat if age<=40
reg usa i.treat  if age<=40
reg state2 i.treat  if age<=40

*Table 5 - High vs. Low Infection States

reg world i.treat if histate==1
reg usa i.treat if histate==1
reg state2 i.treat if histate==1
reg world i.treat if histate==0
reg usa i.treat if histate==0
reg state2 i.treat if histate==0

*Robustness Checks - Appendix

*Table B1
ologit wash1 i.treat
ologit  wash2 i.treat
ologit  cover i.treat
ologit  workh i.treat
ologit  fedreg i.treat
ologit  statereg i.treat

*Table B2
ologit  wash1 i.treat if age<=40
ologit  wash2 i.treat if age<=40
ologit  cover i.treat if age<=40
ologit  workh i.treat if age<=40
ologit  fedreg i.treat if age<=40
ologit  statereg i.treat if age<=40

*Table B3 
ologit world i.treat 
ologit usa i.treat 
ologit state2 i.treat 
ologit world i.treat if age<=40
ologit usa i.treat  if age<=40
ologit state2 i.treat  if age<=40

*Table B4
logit w1 i.treat
logit w2 i.treat 
logit  c1 i.treat 
logit wh1 i.treat 
logit f1 i.treat 
logit sr1 i.treat 

*Table B5
logit w1 i.treat if age<=40
logit w2 i.treat  if age<=40
logit  c1 i.treat  if age<=40
logit wh1 i.treat  if age<=40
logit f1 i.treat  if age<=40
logit sr1 i.treat  if age<=40

*Table B6
logit w11 i.treat 
logit u1 i.treat 
logit ss1 i.treat 
logit w11 i.treat if age<=40
logit u1 i.treat  if age<=40
logit ss1 i.treat  if age<=40

